#include "book.h"

Book::Book(int ID, string name, string author, string publishing_house)
    : ID(ID), name(name), author(author), publishing_house(publishing_house)
{
    state.first = true;
    state.second = "loanable";
}

int Book::get_ID(void)
{
    return ID;
}

string Book::get_name(void)
{
    return name;
}

string Book::get_author(void)
{
    return author;
}

string Book::get_publishing_house(void)
{
    return publishing_house;
}

bool Book::get_state(void)
{
    return state.first;
}

void Book::change_state(void)
{
    if (state.first == true) {
        state.first = false;
        state.second = "borrowed";
    }
    else {
        state.first = true;
        state.second = "loanable";
    }
}

void Book::change_state(string name) 
{

}

void Book::print_message(void)
{
    cout << "ID:" << ID << endl;
    cout << "name:" << name << endl;
    cout << "author:" << author << endl;
    cout << "publishing_house:" << publishing_house << endl;
    cout << "state:" << state.second <<endl;
}